home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / fse / requote.fse < prev    next >
Text File  |  1996-11-10  |  1KB  |  85 lines

  1. /* Will wrap a quoted paragraph and re-quote it.
  2.  * $VER: ReQuote.fse 1.2 (15.04.94)
  3.  */
  4.  
  5. options results
  6.  
  7. delete = '7F'x
  8.  
  9. XPOS
  10. if result ~= 1 then do
  11.   NEWLINE
  12.   NEWLINE
  13.   NEWLINE
  14.   NEWLINE
  15.   backlines = 2
  16. end
  17. else do
  18.   CURRENTCHAR
  19.   if (result = ">") then INSERTINPUT delete
  20.   backlines = 0
  21. end
  22.  
  23. YPOS
  24. breakline = result
  25.  
  26. MSGLENGTH
  27. lastline = result
  28.  
  29. /* Remove quotes from the block */
  30.  
  31. do i=breakline+1 to lastline
  32.   SETPOS 1 i
  33.   CURRENTCHAR
  34.   if (result ~= ">") then break
  35.   INSERTINPUT delete
  36. end
  37.  
  38. /* Fix the section */
  39.  
  40. breakout = 0
  41.  
  42. do i=breakline+1 to lastline
  43.   SETPOS y i
  44.   BEGOFLINE
  45.   XPOS
  46.   if (result = 1) then do
  47.     ENDOFLINE
  48.     XPOS
  49.     if (result ~= 1) then do
  50.       SETPOS y i-1
  51.       ENDOFLINE
  52.       INSERTINPUT delete||'' ''
  53.       YPOS
  54.       if (result = i) then do
  55.         SETPOS x 1
  56.         BACKSPACE
  57.         INSERTINPUT '' ''
  58.       end
  59.       else do
  60.         SETPOS y i
  61.         ENDOFLINE
  62.         XPOS
  63.         if (result = 1) then
  64.           breakout = 1
  65.       end
  66.     end
  67.     else
  68.       breakout = 1
  69.   end
  70.   if (breakout = 1) then break
  71. end
  72.  
  73. /* Re-quote */
  74.  
  75. do i=breakline to lastline
  76.   SETPOS y i
  77.   ENDOFLINE
  78.   XPOS
  79.   if (result = 1) then break
  80.   SETPOS X 1
  81.   INSERTSTRING ">"
  82. end
  83.  
  84. SETPOS 1 breakline-backlines
  85.